home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d13 / pcroct89.arc / DAY.BAT < prev    next >
DOS Batch File  |  1990-03-21  |  1KB  |  29 lines

  1. ECHO OFF
  2. IF "%3"=="" GOTO HELP
  3. IF "%2"=="1" GOTO HELP
  4. IF "%2"=="2" GOTO HELP
  5. :The next line is long. It starts with "ECHO" and ends with "| GWBASIC."
  6. ECHO CLS:PRINT "%1 %2 %3 is"(%1+%1\4-%1\100+%1\400+2.6*%2+1.2+%3) MOD 7"'sday" | GWBASIC
  7. GOTO END
  8. :HELP
  9. ECHO This program finds the day of the week for any date from year AD 1 to AD
  10. ECHO 26000 using the Gregorian calendar we use today (which is only accurate
  11. ECHO to AD 2800). To find the day of the week for 1989 May 11, enter:
  12. ECHO\
  13. ECHO              DAY 1989 5 11
  14. ECHO\
  15. ECHO You must enter January as month 13 of the previous year, and
  16. ECHO February as month 14 of the previous year. To interpret the output:
  17. ECHO\
  18. ECHO     Sunday    is 0'sday
  19. ECHO     Monday    is 1'sday
  20. ECHO     Tuesday   is 2'sday  (mnemonic)
  21. ECHO     Wednesday is 3'sday
  22. ECHO     Thursday  is 4'sday
  23. ECHO     Friday    is 5'sday
  24. ECHO     Saturday  is 6'sday
  25. ECHO\
  26. ECHO For common (non-leap) years, February 29 and March 1 return the same
  27. ECHO answer. For leap years, they return sequential days of the week.
  28. :END
  29.